package ${package}.api.page.${moduleName};

import cn.gooday.jsh.service.common.dto.RestControllerResult;
import cn.gooday.jsh.service.common.mybatis.YlhPageInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import ${package}.dto.api.${moduleName}.Get${ClassName}ParamsDto;
import ${package}.dto.api.${moduleName}.Get${ClassName}ResultDto;
import ${package}.dto.api.${moduleName}.Save${ClassName}ParamsDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ${functionName}相关API.
 */
@Tag(name = "${ClassName}Api", description = "${functionName}相关API")
@RestController
@RequestMapping("/api/page/${moduleName}")
public interface ${ClassName}Api {

  @Operation(summary = "${functionName}列表", description = "${functionName}列表")
  @PostMapping(value = "/list-${moduleName}")
  public RestControllerResult<YlhPageInfo<Get${ClassName}ResultDto>>
          query${ClassName}ListByCondition(
          @RequestBody Get${ClassName}ParamsDto paramsDto);

  @Operation(summary = "${functionName}详情", description = "${functionName}详情",
      parameters = {
        @Parameter(name = "id", description = "${functionName}id",  required = true)
      },
      responses = {
          @ApiResponse(description = "返回查询结果",
              content = @Content(mediaType = "application/json",
                  schema = @Schema(implementation = Get${ClassName}ResultDto.class)))})
  @GetMapping(value = "/${moduleName}/{id}")
  public RestControllerResult<Get${ClassName}ResultDto>
          get${ClassName}ById(
          @Parameter(description = "${functionName}",
          required = true, in = ParameterIn.PATH) @PathVariable Integer id);


  @Operation(summary = "新建${functionName}", description = "新建${functionName}")
  @PostMapping(value = "/insert-${moduleName}")
  public RestControllerResult<Get${ClassName}ResultDto>
          add${ClassName}(
          @RequestBody Save${ClassName}ParamsDto paramsDto);

  @Operation(summary = "修改${functionName}", description = "修改${functionName}")
  @PostMapping(value = "/update-${moduleName}")
  public RestControllerResult<Get${ClassName}ResultDto>
            update${ClassName}(
            @RequestBody Save${ClassName}ParamsDto paramsDto);

  @Operation(summary = "删除${functionName}", description = "删除${functionName}",
      parameters = {
          @Parameter(name = "id", description = "${functionName}id", required = true)
      },
      responses = {
          @ApiResponse(description = "返回查询结果列表",
              content = @Content(mediaType = "application/json",
                  schema = @Schema(implementation = Boolean.class)))})
  @PostMapping(value = "/remove-${moduleName}")
  public RestControllerResult<Boolean> delete${ClassName}ById(Integer id);

  @Operation(summary = "修改${functionName}状态", description = "修改${functionName}状态",
      parameters = {
          @Parameter(name = "id", description = "${functionName}id", required = true),
          @Parameter(name = "status", description = "状态值 0.禁用 1.启用", required = true)
      })
  @PostMapping(value = "/update-${moduleName}-status")
  RestControllerResult<Integer> change${ClassName}StatusById(Integer id, Integer status);
}